<?php

namespace App\Entity;

use ApiPlatform\Core\Annotation\ApiResource;
use App\Base\Annotation\Common;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
use Symfony\Component\Serializer\Annotation\Groups;

/**
 * @ApiResource()
 * @ODM\Document(repositoryClass="App\Repository\SiteRepository")
 */
class Site
{
    /**
     * @Common(cnName="#",editType="text",listType="text")
     * @ODM\Id(strategy="INCREMENT")
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     * @Groups({"site"})
     */
    private $id;

    /**
     * @Common(cnName="站名",editType="text",listType="text")
     * @ODM\Field( nullable=true)
     * @ORM\Column(type="string", length=255)
     * @Groups({"site"})
     */
    private $name;

    /**
     * @Common(cnName="地址",editType="text",listType="text")
     * @ODM\Field( nullable=true)
     * @ORM\Column(type="string", length=255, nullable=true)
     * @Groups({"site"})
     */
    private $address;

    /**
     * @Common(cnName="纬度",editType="text",listType="text")
     * @ODM\Field(type="raw", nullable=true)
     * @ORM\Column(type="float", nullable=true)
     * @Groups({"site"})
     */
    private $lat;

    /**
     * @Common(cnName="经度度",editType="text",listType="text")
     * @ODM\Field(type="raw", nullable=true)
     * @ORM\Column(type="float", nullable=true)
     * @Groups({"site"})
     */
    private $lon;

    /**
     * @Common(cnName="国标价",editType="text",listType="text")
     * @ODM\Field(type="raw", nullable=true)
     * @ORM\Column(type="float", nullable=true)
     * @Groups({"site"})
     */
    private $priceOrg;

    /**
     * @Common(cnName="优惠价",editType="text",listType="text")
     * @ODM\Field(type="raw", nullable=true)
     * @ORM\Column(type="float", nullable=true)
     * @Groups({"site"})
     */
    private $priceSale;

    /**
     * @Common(cnName="是否营业",editType="switch",listType="text")
     * @ODM\Field(type="boolean", nullable=true)
     * @ORM\Column(type="boolean", nullable=true)
     * @Groups({"site"})
     */
    private $isOpen;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getName(): ?string
    {
        return $this->name;
    }

    public function setName(string $name): self
    {
        $this->name = $name;

        return $this;
    }

    public function getAddress(): ?string
    {
        return $this->address;
    }

    public function setAddress(?string $address): self
    {
        $this->address = $address;

        return $this;
    }

    public function getLat(): ?float
    {
        return $this->lat;
    }

    public function setLat(?float $lat): self
    {
        $this->lat = $lat;

        return $this;
    }

    public function getLon(): ?float
    {
        return $this->lon;
    }

    public function setLon(?float $lon): self
    {
        $this->lon = $lon;

        return $this;
    }

    public function getPriceOrg(): ?float
    {
        return $this->priceOrg;
    }

    public function setPriceOrg(?float $priceOrg): self
    {
        $this->priceOrg = $priceOrg;

        return $this;
    }

    public function getPriceSale(): ?float
    {
        return $this->priceSale;
    }

    public function setPriceSale(?float $priceSale): self
    {
        $this->priceSale = $priceSale;

        return $this;
    }

    public function getIsOpen(): ?bool
    {
        return $this->isOpen;
    }

    public function setIsOpen(?bool $isOpen): self
    {
        $this->isOpen = $isOpen;

        return $this;
    }
}
